﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterSGA.Master" AutoEventWireup="true" CodeBehind="EditSupporter.aspx.cs" Inherits="SGA.Support.EditSupporter" Culture="pt-PT" UICulture="pt" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ScriptManager" runat="server" EnableScriptGlobalization="True"></ajaxToolkit:ToolkitScriptManager>
    <script type="text/javascript" src="../Scripts/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/Scripts/bootstrap.min.js"></script>

    <%--<script type="text/javascript">
        $(function () {
            $('#tabs a:first').tab('show')
        })

        function noPostBack() {
            return false;
        }

        //function changeTab(tabNumber) {
        //    $(function () {
        //        $('#tabs li:eq(' + tabNumber + ') a').tab('show')
        //    })
        //}
    </script>--%>

    <asp:UpdatePanel ID="UpdateLoading" runat="server">
        <ContentTemplate>

            <!-- Start: Data source -->
            <asp:EntityDataSource ID="EDSTreatments" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Treatments" EntityTypeFilter="Treatments" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSContactTypes" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="ContactTypes" EntityTypeFilter="ContactTypes" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSSituations" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Situations" EntityTypeFilter="Situations" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSSendThankLetters" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="SendThankLetters" EntityTypeFilter="SendThankLetters" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSProfessions" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Professions" EntityTypeFilter="Professions" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSAddressTypes" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="AddressTypes" EntityTypeFilter="AddressTypes" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSCountries" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Countries" EntityTypeFilter="Countries" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSHonorificTitles" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="HonorificTitles" EntityTypeFilter="HonorificTitles" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSCompanies" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Companies" EntityTypeFilter="Companies" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EDSHeldPositions" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="HeldPositions" EntityTypeFilter="HeldPositions" OrderBy="" AutoPage="False" AutoSort="False" AutoGenerateOrderByClause="True" Select="">
                <OrderByParameters>
                    <asp:Parameter DefaultValue="Designation" Name="newparameter" />
                </OrderByParameters>
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSSupporters" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Supporters" EntityTypeFilter="Supporters" Include="Countries, HeldPositions, Professions, SendThankLetters, AddressTypes, Companies, HonorificTitles,SystemUsers" EnableUpdate="True" AutoGenerateWhereClause="True" EnableInsert="True"></asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSupporterContacts" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="SupporterContacts" EntityTypeFilter="SupporterContacts" Include="ContactTypes"></asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSExpeditions" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Expeditions" EntityTypeFilter="Expeditions" Include="Campaigns, Responses, Responses.ResponsesReceiptsInvoices.Invoices, Responses.ResponsesReceiptsInvoices.Receipts, Responses.PaymentModes, Responses.Currencys, Responses.ControlThankLetters" AutoGenerateWhereClause="True"></asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSMaterialOrders" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="MaterialOrders" EntityTypeFilter="MaterialOrders" Include="Supporters, Products"></asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSInvoices" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities"></asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSReceipts" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities"></asp:EntityDataSource>
            <%-- Data sources--%>

            <asp:EntityDataSource ID="EDSAssociates" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="Associates" EntityTypeFilter="Associates" Include="Supporters, SystemUsers" EnableUpdate="True" AutoGenerateWhereClause="True" EnableInsert="True">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSDonationSituations" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EnableFlattening="False" EntitySetName="DonationSituations">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSCollectingRanges" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EnableFlattening="False"
                EntitySetName="CollectingRanges" EntityTypeFilter="CollectingRanges"
                Where="it.IsActive=true" OrderBy="it.CollectingDay">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSBankColletingTypes" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="BankCollectingTypes">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSCollectingAmendments" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="CollectingAmendments" EntityTypeFilter="" OrderBy="" Select="">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSSuspensionContacTypes" runat="server" ConnectionString="name=MailingEntities" DefaultContainerName="MailingEntities" EnableFlattening="False" EntitySetName="SuspensionContactTypes" OrderBy="">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="EDSReasonForSuspension" runat="server" DefaultContainerName="MailingEntities" ConnectionString="name=MailingEntities" EntitySetName="ReasonsForSuspensions" OrderBy="" AutoPage="False" AutoGenerateOrderByClause="True" EnableFlattening="False">
            </asp:EntityDataSource>
            <!-- End: Data source -->

            <asp:HiddenField runat="server" ID="HiddenFieldIdSupportersGlobal" />

            <div class="container-fluid">

                <div class="row">
                    <div class="col-md-1 sidebar">
                        <%--<div class="col-md-1">--%>
                        <ul class="nav nav-pills nav-stacked">
                            <li class="active">
                                <asp:Button ID="SaveButton" runat="server" Text="Guardar" CssClass="btn btn-default navbar-btn" Width="100" />
                            </li>
                            <li>
                                <asp:Button ID="UpdateButton" runat="server" Text="Atualizar" Visible="false" CssClass="btn btn-default navbar-btn" Width="100" OnClick="UpdateButton_Click" />
                            </li>
                            <li>
                                <asp:Button ID="ReatamentoBtn" runat="server" Text="Reatar" CssClass="btn btn-default navbar-btn" Visible="false" Width="100" OnClick="ReatamentoBtn_Click" />
                            </li>
                            <li>
                                <asp:Button ID="ReceiptsBtn" runat="server" Text="Recibos" CssClass="btn btn-default navbar-btn" Visible="false" Width="100" />
                            </li>
                            <li>
                                <asp:Button ID="CheckIBANBtn" runat="server" Text="Verificar IBAN" CssClass="btn btn-default" Visible="false" Width="100" OnClick="CheckIBANBtn_Click" />
                            </li>
                            <li>
                                <asp:Button ID="BackButton" runat="server" Text="Voltar" CssClass="btn btn-default navbar-btn" Width="100" OnClick="BackButton_Click" CausesValidation="False" />
                            </li>
                        </ul>

                        <%--Start: Update progress control--%>
                        <asp:UpdateProgress ID="UpdateProgressLoading" runat="server" AssociatedUpdatePanelID="UpdateLoading">
                            <ProgressTemplate>
                                <img alt="Progresso" src="/Images/progress.gif" />
                                Processar...
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                        <%--End: Update progress control--%>
                    </div>

                    <div class="col-md-11 main">
                        <h3>
                            <asp:Label runat="server" ID="TabAssociado_SupporterName"></asp:Label>
                        </h3>
                        <div id="divStatus">
                            <%--<asp:Label ID="NotificationLabel" runat="server"></asp:Label>--%>
                            <asp:Label ID="NotificationLabel" runat="server" Font-Bold="False" ForeColor="White" Visible="False" BackColor="Red" />
                        </div>

                        <ajaxToolkit:TabContainer ID="SupporterTabContainer" CssClass="MyCustomTab" runat="server" ActiveTabIndex="0" Height="600px" Width="1200px" ScrollBars="Auto" AutoPostBack="True" OnActiveTabChanged="SupporterTabContainer_ActiveTabChanged">
                            <ajaxToolkit:TabPanel ID="SupporterTabPanel" runat="server" HeaderText="Aderente">
                                <ContentTemplate>
                                    <asp:FormView ID="FVSupporters" runat="server" DefaultMode="Edit" DataKeyNames="Id" OnItemUpdating="FVSupporters_ItemUpdating">
                                        <EditItemTemplate>
                                            <%--Num. Supporter, Últ. modif. e usr--%>
                                            <div class="form-group">
                                                <div class="row">
                                                    <div class="col-md-2">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Id</span>
                                                            <asp:TextBox ID="IdSupportersTextBox" CssClass="form-control input-sm text-right" Text='<%#Eval("Id") %>' placeholder="Número" runat="server" disabled />
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data obtenção</span>
                                                            <asp:TextBox ID="ObtainDateTextBox" CssClass="form-control input-sm" placeholder="Data obtenção" Text='<%# String.Format("{0:dd/MM/yyyy}",Eval("ObtainDate")) %>' runat="server" disabled />
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3 col-md-offset-2">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Últ. modif.</span>
                                                            <asp:TextBox ID="LastModificationTbox" runat="server" class="form-control input-sm text-right" disabled
                                                                Text='<%# String.Format("{0:dd/MM/yyyy}",Eval("LastModify")) %>'>
                                                            </asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-2">
                                                        <asp:TextBox ID="UserTbox" runat="server" class="form-control input-sm" disabled placeholder="User"
                                                            Text='<%#Eval("SystemUsers.Alias") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </div>
                                            </div>

                                            <%--dados pessoais--%>
                                            <div class="row">
                                                <div class="form-group">
                                                    <div class="col-sm-6">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Tratamento</span>
                                                            <asp:DropDownList ID="TreatmentsDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdTreatment") %>' DataTextField="Designation" AppendDataBoundItems="true" DataValueField="Id" runat="server" DataSourceID="EDSTreatments">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Nome</i></span>
                                                            <asp:TextBox ID="NameTextBox" CssClass="form-control" placeholder="Nome" Text='<%#Bind("Designation") %>' runat="server" Columns="50" />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Endereço</span>
                                                            <asp:TextBox ID="AddressTextBox" CssClass="form-control" placeholder="Morada" Text='<%#Bind("Address") %>' runat="server" Columns="50" />
                                                            <asp:TextBox ID="ComplementAddressTextBox" CssClass="form-control" placeholder="Complemento morada" Text='<%#Bind("ComplementAddress") %>' runat="server" Columns="50" />
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-1 col-sm-5">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Código-postal</span>
                                                                    <asp:TextBox ID="PostalCodeLocalTextBox" CssClass="form-control" placeholder="CP (4 dig.)" Text='<%#Bind("PostalCodeLocal") %>' runat="server" Columns="10" />
                                                                    <asp:TextBox ID="PostalCodeStreetTextBox" CssClass="form-control" placeholder="CP (3 dig.)" Text='<%#Bind("PostalCodeStreet") %>' runat="server" Columns="3" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-xs-1 col-sm-7">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Nacionalidade</span>
                                                                    <asp:DropDownList ID="IdCountriesDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdCountries") %>' runat="server" DataSourceID="EDSCountries" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                        <asp:ListItem Value=""></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                            <div class="col-xs-1 col-sm-5">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Tipo end.</span>
                                                                    <asp:DropDownList ID="IdAddressTypesDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdAddressTypes") %>' runat="server" DataSourceID="EDSAddressTypes" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                        <asp:ListItem Value=""></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-xs-1 col-sm-12">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Título</i></span>
                                                                    <asp:DropDownList ID="HonorificTitlesDropDownList" CssClass="form-control" SelectedValue='<%#Bind("HonorificTitles.Id") %>' runat="server" DataSourceID="EDSHonorificTitles" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                        <asp:ListItem Value=""></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-xs-1 col-sm-12">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Empresa</span>
                                                                    <asp:DropDownList ID="CompaniesDropDownList" CssClass="form-control" SelectedValue='<%#Bind("Companies.Id") %>' runat="server" DataSourceID="EDSCompanies" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                        <asp:ListItem Value=""></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-2">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Aniversário</i></span>
                                                            <asp:TextBox ID="BirthdayDayTextBox" CssClass="form-control" placeholder="Dia" Text='<%#Eval("Birthdays.BirthdayDay") %>' runat="server" Columns="20" />
                                                            <asp:TextBox ID="BirthdayMonthTextBox" CssClass="form-control" placeholder="Mês" Text='<%#Eval("Birthdays.BirthdayMonth") %>' runat="server" Columns="20" />
                                                            <asp:TextBox ID="BirthdayYearTextBox" CssClass="form-control" placeholder="Ano" Text='<%#Eval("Birthdays.BirthdayYear") %>' runat="server" Columns="20" />
                                                        </div>
                                                    </div>

                                                    <div class="col-md-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Status</span>
                                                            <asp:DropDownList ID="SituationsDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdSituations") %>' runat="server" DataSourceID="EDSSituations" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Carta agradecimento</span>
                                                            <asp:DropDownList ID="SendThankLettersDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdSendThankLetters") %>' runat="server" DataSourceID="EDSSendThankLetters" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>

                                                        <div class="input-group">
                                                            <span class="input-group-addon">Profissão</span>
                                                            <asp:DropDownList ID="ProfessionDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdProfessions") %>' runat="server" DataSourceID="EDSProfessions" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>

                                                        <div class="input-group">
                                                            <span class="input-group-addon">Cargo ocupado</span>
                                                            <asp:DropDownList ID="HeldPositionsDropDownList" CssClass="form-control" SelectedValue='<%#Bind("IdHeldPositions") %>' runat="server" DataSourceID="EDSHeldPositions" DataTextField="Designation" DataValueField="Id" AppendDataBoundItems="True">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>

                                                    <div class="form-group">
                                                        <div class="row">
                                                            <div class="col-md-3">
                                                                <asp:CheckBox ID="CheckBox1" runat="server" Text='Enviar cartão de Natal'
                                                                    Checked='<%# Bind("WantChristmasCard")%>' />

                                                                <%--<asp:Label ID="Label11" runat="server" Text="Cartão de Natal?"></asp:Label>
                                                                <asp:RadioButtonList runat="server" ID="WantChristmasCardRBL" SelectedValue='<%#Bind("WantChristmasCard") %>' RepeatDirection="Vertical">
                                                                    <asp:ListItem Value="False" Text="Não"></asp:ListItem>
                                                                    <asp:ListItem Value="True" Text="Sim"></asp:ListItem>
                                                                    <asp:ListItem Value="" Text="Sem dados"></asp:ListItem>
                                                                </asp:RadioButtonList>--%>
                                                            </div>
                                                            <div class="col-md-3">
                                                                <asp:CheckBox ID="CheckBox2" runat="server" Text='Enviar carta de aniversário'
                                                                    Checked='<%# Bind("WantBirthdayLetter")%>' />

                                                                <%--                                                                <asp:Label ID="Label12" runat="server" Text="Carta de Aniversário?"></asp:Label>
                                                                <asp:RadioButtonList runat="server" ID="WantBirthdayLetterRBL" SelectedValue='<%#Bind("WantBirthdayLetter") %>' RepeatDirection="Vertical">
                                                                    <asp:ListItem Value="False" Text="Não"></asp:ListItem>
                                                                    <asp:ListItem Value="True" Text="Sim"></asp:ListItem>
                                                                    <asp:ListItem Value="" Text="Sem dados"></asp:ListItem>
                                                                </asp:RadioButtonList>--%>
                                                            </div>
                                                            <div class="col-md-3">
                                                                <asp:CheckBox ID="CheckBox3" runat="server" Text='Deseja declaração de IRS'
                                                                    Checked='<%# Bind("WantIRS")%>' />

                                                                <%--                                                                <asp:Label ID="Label13" runat="server" Text="Declaração de IRS?"></asp:Label>
                                                                <asp:RadioButtonList runat="server" ID="WantIRSCheckRBL" SelectedValue='<%#Bind("WantIRS") %>' RepeatDirection="Vertical">
                                                                    <asp:ListItem Value="False" Text="Não"></asp:ListItem>
                                                                    <asp:ListItem Value="True" Text="Sim"></asp:ListItem>
                                                                    <asp:ListItem Value="" Text="Sem dados"></asp:ListItem>
                                                                </asp:RadioButtonList>--%>
                                                            </div>
                                                            <div class="col-md-3">
                                                                <asp:CheckBox ID="CheckBox4" runat="server" Text='Partilhar dados pessoais'
                                                                    Checked='<%# Bind("WantShareData")%>' />

                                                                <%--                                                                <asp:Label ID="Label14" runat="server" Text="Partilhar dados pessoais?"></asp:Label>
                                                                <asp:RadioButtonList runat="server" ID="WantShareDataRBL" SelectedValue='<%#Bind("WantShareData") %>' RepeatDirection="Vertical">
                                                                    <asp:ListItem Value="False" Text="Não"></asp:ListItem>
                                                                    <asp:ListItem Value="True" Text="Sim"></asp:ListItem>
                                                                    <asp:ListItem Value="" Text="Sem dados"></asp:ListItem>
                                                                </asp:RadioButtonList>--%>
                                                            </div>
                                                            <div class="col-md-3">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Mat. devolvido</span>
                                                                    <asp:TextBox ID="AmountReturnedMailTextBox" CssClass="form-control" disabled placeholder="Qt devoluções" Text='<%#Bind("AmountReturnedMail") %>' runat="server" Columns="20" />
                                                                </div>
                                                            </div>
                                                            <div class="col-md-5">
                                                                <div class="input-group">
                                                                    <span class="input-group-addon">Obs</span>
                                                                    <asp:TextBox runat="server" ID="ObservationsTextBox" placeholder="Observações" CssClass="form-control" Text='<%#Bind("Observations") %>' TextMode="MultiLine" Height="90px" Width="515px"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </EditItemTemplate>
                                    </asp:FormView>

                                    <div class="row">
                                        <div class="col-md-4">
                                            <%--Start: Listview control--%>
                                            <asp:ListView ID="LVSupporterContacts" DataKeyNames="Id" runat="server" OnItemInserting="LVSupporterContacts_ItemInserting" OnItemCommand="LVSupporterContacts_ItemCommand" InsertItemPosition="FirstItem">
                                                <InsertItemTemplate>
                                                    <ajaxToolkit:HoverMenuExtender ID="HoverMenu" runat="server"
                                                        PopupControlID="PopupMenu"
                                                        PopupPosition="Right"
                                                        TargetControlID="PopupRow"
                                                        PopDelay="50" HoverDelay="10" OffsetX="-10" OffsetY="-40" />

                                                    <tr runat="server" id="PopupRow">
                                                        <td>
                                                            <asp:HiddenField runat="server" ID="HiddenFieldIdSupporters" Value='<%# Bind("IdSupporters") %>' />
                                                            <asp:DropDownList ID="DropDownListContactTypes" CssClass="form-control" runat="server" DataSourceID="EDSContactTypes" DataValueField="Id" DataTextField="Designation" SelectedValue='<%# Bind("IdContactTypes") %>'></asp:DropDownList>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TextBoxDesignation" CssClass="form-control" runat="server" Text='<%# Bind("Designation") %>'></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFielDesignation" runat="server" ErrorMessage="O contato é obrigatório." CssClass="Alert" Display="Dynamic" ControlToValidate="TextBoxDesignation" SetFocusOnError="True" ValidationGroup="InsertItem"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>

                                                    <asp:Panel ID="PopupMenu" runat="server" Width="200" Style="display: none">
                                                        <div class="panel panel-default">
                                                            <div class="panel-heading">Inserir novo contacto</div>
                                                            <div class="panel-body">
                                                                <asp:LinkButton ID="LinkButtonInsert" runat="server" Text="Adicionar" CommandName="Insert" ValidationGroup="InsertItem" CommandArgument='<%#Eval("Id") %>'></asp:LinkButton>
                                                                <br />
                                                                <asp:LinkButton ID="LinkButtonCancel" runat="server" Text="Cancelar" CommandName="Cancel" CausesValidation="false"></asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </asp:Panel>
                                                </InsertItemTemplate>
                                                <EditItemTemplate>
                                                    <ajaxToolkit:HoverMenuExtender ID="HoverMenu" runat="server"
                                                        PopupControlID="PopupMenu"
                                                        PopupPosition="Right"
                                                        TargetControlID="PopupRow"
                                                        PopDelay="50" HoverDelay="10" OffsetX="-10" OffsetY="-40" />

                                                    <tr runat="server" id="PopupRow">
                                                        <td>
                                                            <asp:DropDownList ID="DropDownListContactTypes" CssClass="form-control" runat="server" DataSourceID="EDSContactTypes" DataValueField="Id" DataTextField="Designation" SelectedValue='<%# Bind("IdContactTypes") %>'></asp:DropDownList>
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TextBoxDesignation" CssClass="form-control" runat="server" Text='<%# Bind("Designation") %>'></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFielDesignation" runat="server" ErrorMessage="O contato é obrigatório." CssClass="Alert" Display="Dynamic" ControlToValidate="TextBoxDesignation" SetFocusOnError="True" ValidationGroup="EditItem"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>

                                                    <asp:Panel ID="PopupMenu" runat="server" Width="200" Style="display: none">
                                                        <div class="panel panel-default">
                                                            <div class="panel-heading"><%# Eval("ContactTypes.Designation")%></div>
                                                            <div class="panel-body">
                                                                <asp:LinkButton ID="LinkButtonCancel" runat="server" Text="Cancelar" CommandName="Cancel" CausesValidation="False"></asp:LinkButton>
                                                                <br />
                                                                <asp:LinkButton ID="LinkButtonUpdate" runat="server" Text="Atualizar" CommandName="Update" ValidationGroup="EditItem" CommandArgument='<%#Eval("Id") %>'></asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </asp:Panel>

                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <ajaxToolkit:HoverMenuExtender ID="HoverMenu" runat="server"
                                                        PopupControlID="PopupMenu"
                                                        PopupPosition="Right"
                                                        TargetControlID="PopupRow"
                                                        PopDelay="50" HoverDelay="10" OffsetX="-10" OffsetY="-40" />

                                                    <tr runat="server" id="PopupRow">
                                                        <td><%# Eval("ContactTypes.Designation") %></td>
                                                        <td><%# Eval("Designation") %></td>
                                                    </tr>

                                                    <asp:Panel ID="PopupMenu" runat="server" Width="200" Style="display: none">
                                                        <div class="panel panel-default">
                                                            <div class="panel-heading"><%# Eval("ContactTypes.Designation")%></div>
                                                            <div class="panel-body">
                                                                <asp:LinkButton ID="LinkButtonDelete" runat="server" Text="Remover" CommandName="Delete" CommandArgument='<%#Eval("Id") %>' OnClientClick="javascript:return confirm('Deseja remover?')"></asp:LinkButton>
                                                                <br />
                                                                <asp:LinkButton ID="LinkButtonEdit" runat="server" Text="Editar" CommandName="Edit" CommandArgument='<%#Eval("Id") %>'></asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </asp:Panel>
                                                </ItemTemplate>
                                                <LayoutTemplate>
                                                    <table id="userTable" runat="server" class="table table-hover table-bordered">
                                                        <tr>
                                                            <th>Tipo contato</th>
                                                            <th>Contato</th>
                                                        </tr>
                                                        <tr id="itemPlaceholder" runat="server">
                                                        </tr>
                                                    </table>
                                                </LayoutTemplate>
                                            </asp:ListView>
                                            <%--End: Listview control--%>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                            <%-----------------------------------%>
                            <%--Separador de dados de associado--%>
                            <ajaxToolkit:TabPanel ID="AssociateTabPanel" runat="server" HeaderText="Associado">
                                <ContentTemplate>
                                    <asp:FormView ID="FVAssociates" runat="server" DefaultMode="Edit">
                                        <EditItemTemplate>
                                            <%--<asp:Label ID="NotificationLabel" runat="server" Font-Bold="False" ForeColor="White" Visible="False" BackColor="Red" />--%>
                                            <div class="form-group">
                                                <div class="row">
                                                    <div class="col-md-2">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Num.</span>
                                                            <asp:TextBox ID="NumSupporterTbox" runat="server" class="form-control input-sm text-right" disabled placeholder="Número"
                                                                Text='<%#Eval("IdSupporters")%>'></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-4">
                                                        <asp:TextBox ID="NameSupporterTbox" runat="server" class="form-control input-sm" disabled placeholder="Nome"
                                                            Text='<%#Eval("Supporters.Designation")%>'></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-2">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Últ. modif.</span>
                                                            <asp:TextBox ID="LastModificationTbox" runat="server" class="form-control input-sm text-right" disabled
                                                                Text='<%# String.Format("{0:dd/MM/yyyy}",Eval("LastModification")) %>'></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-2">
                                                        <asp:TextBox ID="UserTbox" runat="server" class="form-control input-sm" disabled placeholder="User"
                                                            Text='<%#Eval("SystemUsers.Alias") %>'>
                                                        </asp:TextBox>

                                                    </div>
                                                </div>
                                            </div>

                                            <%--dados bancários--%>
                                            <div class="form-group">
                                                <div class="row">
                                                    <div class="col-md-7">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Nome de</span>
                                                            <asp:TextBox ID="NameOfTbox" runat="server" class="form-control"
                                                                Text='<%#Bind("NameOf")%>'>
                                                            </asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data obtenção</span>
                                                            <asp:TextBox ID="ObtainDateTbox" runat="server" class="form-control text-right" disabled
                                                                Text='<%#Bind("ObtainingDate")%>'>
                                                            </asp:TextBox>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <div class="row">
                                                    <%--div esquerdo--%>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">País (IBAN)</span>
                                                            <asp:TextBox ID="CountryBankTbox" runat="server" class="form-control text-right" AutoPostBack="True"
                                                                Text='<%#Bind("CountryBank")%>'>
                                                            </asp:TextBox>
                                                            <asp:RegularExpressionValidator ID="regexIBAN" runat="server" ErrorMessage="Dados inválidos!" ControlToValidate="CountryBankTbox" CssClass="Alert" Display="Dynamic" ForeColor="White" ValidationExpression="^[a-zA-Z]{2}[0-9]{2}$" BackColor="Red"></asp:RegularExpressionValidator>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Banco</span>
                                                            <asp:TextBox ID="NumberBankTbox" runat="server" class="form-control text-right" AutoPostBack="True" OnTextChanged="NumberBankTbox_TextChanged"
                                                                Text='<%#Bind("NumberBank")%>' />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Agência</span>
                                                            <asp:TextBox ID="NumberAgencyTbox" runat="server" class="form-control text-right" AutoPostBack="True" OnTextChanged="NumberAgencyTbox_TextChanged"
                                                                Text='<%#Bind("NumberAgency")%>' />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Nº conta</span>
                                                            <asp:TextBox ID="NumberAccountTbox" runat="server" class="form-control text-right" AutoPostBack="True" OnTextChanged="NumberAgencyTbox_TextChanged"
                                                                Text='<%#Bind("NumberAccount")%>' />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Digito contolo</span>
                                                            <asp:TextBox ID="CheckDigitAccountTbox" runat="server" class="form-control text-right" AutoPostBack="True" OnTextChanged="NumberAgencyTbox_TextChanged"
                                                                Text='<%#Bind("CheckDigitAccount")%>' />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">SWIFT/BIC</span>
                                                            <asp:TextBox ID="BICTbox" runat="server" class="form-control text-right"
                                                                Text='<%#Bind("BIC")%>' />
                                                        </div>

                                                        <%--<asp:Label ID="InvalidIbanNibLbl" runat="server" Text="IBAN/NIB inválido!" Font-Bold="False" ForeColor="White" Visible="False" BackColor="Red" />--%>
                                                    </div>

                                                    <%--div centro--%>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Tipo contribuição</span>
                                                            <asp:DropDownList ID="DonationSituationDdl" CssClass="form-control" runat="server" AppendDataBoundItems="True"
                                                                DataSourceID="EDSDonationSituations" DataTextField="Designation" DataValueField="Id"
                                                                SelectedValue='<%#Bind("IdDonationSituations") %>'>
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Valor contribuição</span>
                                                            <asp:TextBox ID="ValueDonationTbox" class="form-control text-right" runat="server"
                                                                Text='<%#Bind("ValueDonation")%>' />
                                                            <asp:RegularExpressionValidator ID="regexValueDonation" runat="server" ErrorMessage="Valor inválido!" ControlToValidate="ValueDonationTbox" CssClass="Alert" Display="Dynamic" ForeColor="White" ValidationExpression="^(\d+(((\.|\,)\d)?|((\.|\,)\d\d)?))$" BackColor="Red"></asp:RegularExpressionValidator>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data cobrança</span>
                                                            <asp:DropDownList ID="CollectingDateDdl" class="form-control" runat="server" AppendDataBoundItems="True"
                                                                DataSourceID="EDSCollectingRanges" DataValueField="Id" DataTextField="CollectingDay"
                                                                SelectedValue='<%#Bind("IdCollectingRanges") %>'>
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Valor máximo</span>
                                                            <asp:TextBox ID="MaxDonationTbox" class="form-control text-right" runat="server"
                                                                Text='<%#Bind("MaxDonation")%>' />
                                                            <asp:RegularExpressionValidator ID="regexMaxDonation" runat="server" ErrorMessage="Valor inválido!" ControlToValidate="MaxDonationTbox" CssClass="Alert" Display="Dynamic" ForeColor="White" ValidationExpression="^(\d+(((\.|\,)\d)?|((\.|\,)\d\d)?))$" BackColor="Red"></asp:RegularExpressionValidator>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Valor contribuição alternativo</span>
                                                            <asp:TextBox ID="AlternativeCollectingValueTbox" CssClass="form-control text-right" runat="server"
                                                                Text='<%#Bind("AlternativeCollectingValue")%>' />
                                                            <asp:RegularExpressionValidator ID="regexAlternativeValue" runat="server" ErrorMessage="Valor inválido!" ControlToValidate="AlternativeCollectingValueTbox" CssClass="Alert" Display="Dynamic" ForeColor="White" ValidationExpression="^(\d+(((\.|\,)\d)?|((\.|\,)\d\d)?))$" BackColor="Red"></asp:RegularExpressionValidator>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data cobrança alternativa</span>
                                                            <asp:DropDownList ID="AlternativeCollectingDateDdl" CssClass="form-control" runat="server" AppendDataBoundItems="True"
                                                                DataSourceID="EDSCollectingRanges" DataValueField="Id" DataTextField="CollectingDay"
                                                                SelectedValue='<%#Bind("IdCollectingRangesAlternative") %>'>
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>

                                                    <%--div direita--%>
                                                    <div class="col-md-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Status tipo cobrança</span>
                                                            <asp:DropDownList ID="BankCollectingTypesDdl" CssClass="form-control" runat="server"
                                                                DataSourceID="EDSBankColletingTypes" DataValueField="Id" DataTextField="Designation"
                                                                SelectedValue='<%#Bind("IdBankCollectingTypes") %>'>
                                                            </asp:DropDownList>
                                                            <%--<ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="SuspensionDateTbox" DaysModeTitleFormat="dd-MM-yyyy" Enabled="True" Format="dd-MM-yyyy" TodaysDateFormat="dd-MM-yyyy" CssClass="MyCalendar"></ajaxToolkit:CalendarExtender>--%>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Alterações cobrança</span>
                                                            <asp:DropDownList ID="ColletionAmendmentDdl" CssClass="form-control" runat="server"
                                                                DataSourceID="EDSCollectingAmendments" DataTextField="Designation" DataValueField="Id"
                                                                SelectedValue='<%#Bind("IdCollectingAmendments") %>'>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Nº autorização actual</span>
                                                            <asp:TextBox ID="ActualAuthorizTbox" runat="server" CssClass="form-control text-right" disabled
                                                                Text='<%# SequenceNumber(Eval("ResumingSequence").ToString()) %>' />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Sequência da autorização</span>
                                                            <%--<asp:TextBox ID="SequenceTbox" runat="server" Columns="5" OnTextChanged="SequenceTbox_TextChanged" />--%>
                                                            <asp:TextBox ID="SequenceTbox" class="form-control text-right" runat="server" AutoPostBack="True" OnTextChanged="SequenceTbox_TextChanged"
                                                                Text='<%#Bind("ResumingSequence")%>' />
                                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="SequenceTbox" CssClass="Alert" Display="Dynamic" ErrorMessage="Valor inválido!" ValidationExpression="^([0-9]+)$" BackColor="Red" ForeColor="White"></asp:RegularExpressionValidator>
                                                        </div>
                                                        <asp:CheckBox ID="WantReceiptCbox" runat="server" Text='Enviar recibo mensal'
                                                            Checked='<%# Bind("WantReceipt")%>' />
                                                    </div>
                                                </div>
                                            </div>

                                            <%--cancelamento--%>
                                            <div class="form-group">
                                                <div class="row">
                                                    <%--div esquerda--%>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data suspensão</span>
                                                            <asp:TextBox ID="SuspensionDateTbox" class="form-control text-right" runat="server" />
                                                            <%--<ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="SuspensionDateTbox" DaysModeTitleFormat="dd-MM-yyyy" Enabled="True" Format="dd-MM-yyyy" TodaysDateFormat="dd-MM-yyyy" CssClass="MyCalendar"></ajaxToolkit:CalendarExtender>--%>
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Motivo</span>
                                                            <asp:DropDownList ID="ReasonSuspDdl" CssClass="form-control" runat="server" AppendDataBoundItems="True"
                                                                DataSourceID="EDSReasonForSuspension"
                                                                DataTextField="Designation" DataValueField="Id">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>

                                                    <%--div esquerda--%>
                                                    <div class="col-md-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Forma de contacto</span>
                                                            <asp:DropDownList ID="SuspensionContatTypeDdl" class="form-control" runat="server" AppendDataBoundItems="True"
                                                                DataSourceID="EDSSuspensionContacTypes"
                                                                DataTextField="Designation" DataValueField="Id">
                                                                <asp:ListItem Value=""></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>

                                                    <%--div direita--%>
                                                    <div class="col-md-3">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Data reatamento</span>
                                                            <asp:TextBox ID="ResumingDateTbox" runat="server" class="form-control text-right" />
                                                        </div>
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Nº autorização nova</span>
                                                            <asp:TextBox ID="ResumingNewSequenceTbox" runat="server" class="form-control text-right" disabled />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <%--Observações--%>
                                            <div class="form-group">
                                                <div class="row">
                                                    <%--<h4 class="sub-header">Dados da cobrança</h4>--%>
                                                    <div class="col-md-10">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">Observações</span>
                                                            <asp:TextBox ID="ObservationsTbox" runat="server" class="form-control" TextMode="multiline" Rows="5"
                                                                Text='<%#Bind("Observations")%>' />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </EditItemTemplate>
                                    </asp:FormView>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                            <%-----------------------------------%>
                            <%--Separador Mailing--%>
                            <ajaxToolkit:TabPanel ID="MailingTabPanel" runat="server" HeaderText="Mailing">
                                <ContentTemplate>

                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <%--<asp:ListView ID="LVMailing" runat="server" DataKeyNames="Id" OnItemEditing="LVMailing_ItemEditing" OnItemCommand="LVMailing_ItemCommand" ClientIDMode="AutoID">--%>
                                                <asp:ListView ID="LVMailing" runat="server" DataKeyNames="Id" OnItemCommand="LVMailing_ItemCommand" ClientIDMode="AutoID">
                                                    <EmptyDataTemplate>
                                                        O aderente <%# Eval("Supporters.Designation") %> não tem mailings enviados.
                                                    </EmptyDataTemplate>
                                                    <EditItemTemplate>
                                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBoxReceiveDate" DaysModeTitleFormat="dd-MM-yyyy" Enabled="True" Format="dd-MM-yyyy" TodaysDateFormat="dd-MM-yyyy" CssClass="MyCalendar"></ajaxToolkit:CalendarExtender>
                                                        <tr>
                                                            <td>
                                                                <%# Eval("Campaigns.Designation") %>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control"></asp:TextBox></td>
                                                            <td>
                                                                <asp:TextBox runat="server" ID="TextBoxReceiveDate" CssClass="form-control"></asp:TextBox></td>
                                                            <td>
                                                                <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control"></asp:TextBox></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                        </tr>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td>
                                                                <%--<asp:LinkButton ID="LinkButton1" runat="server" UseSubmitBehavior="false" Text='<%# Eval("Campaigns.Designation") %>' CausesValidation="False" CommandName="Edit"></asp:LinkButton></td>--%>
                                                                <asp:LinkButton ID="LinkButton2" runat="server" Text='<%# Eval("Campaigns.Designation") %>' CausesValidation="False" CommandName="Edit"></asp:LinkButton></td>
                                                            <td><%# Eval("Responses.InicialValue") %></td>
                                                            <td><%# String.Format("{0:dd/MM/yyyy}",Eval("Responses.ReceiveDate")) %></td>
                                                            <td><%# Eval("Responses.FinalValue") %></td>
                                                            <td><%# Eval("Responses.PaymentModes.Designation") %></td>
                                                            <td><%# Eval("Responses.ForeignReceiveDate") %></td>
                                                            <td><%# Eval("Responses.Currencys.Designation") %></td>
                                                            <td><%# Eval("Responses.ForeignPaidValue") %></td>
                                                            <td><%# Eval("Responses.SendThanksLetter") %></td>
                                                            <td><%# Eval("Responses.SendThanksLetter") %></td>
                                                            <td><%# Eval("Responses.ControlThankLetters.Id") %></td>
                                                            <td><%# Eval("Responses.ResponsesReceiptsInvoices.Receipts.Designation") %></td>
                                                            <td><%# Eval("Responses.ResponsesReceiptsInvoices.Invoices.Designation") %></td>
                                                            <td><%# String.Format("{0:dd/MM/yyyy}",Eval("Responses.CreditDate")) %></td>
                                                            <td><%# Eval("Responses.IdSystemUsers") %></td>
                                                            <td><%# Eval("Responses.LastModify") %></td>
                                                        </tr>
                                                    </ItemTemplate>

                                                    <LayoutTemplate>
                                                        <table id="Table1" runat="server" class="table table-hover table-bordered">
                                                            <tr>
                                                                <th>Campanha</th>
                                                                <th>Valor inicial</th>
                                                                <th>Data receção</th>
                                                                <th>Valor efetivo</th>
                                                                <th>Forma pagamento</th>
                                                                <th>Data (estrangeira)</th>
                                                                <th>Moeda</th>
                                                                <th>Valor efetivo (estrangeiro)</th>
                                                                <th>Quer recibo?</th>
                                                                <th>Carta agradecimento enviada?</th>
                                                                <th>Lote</th>
                                                                <th>Nr fatura</th>
                                                                <th>Nr recibo</th>
                                                                <th>Data crédito</th>
                                                                <th>Utilizador</th>
                                                                <th>Data alteração</th>
                                                            </tr>
                                                            <tr id="itemPlaceholder" runat="server">
                                                            </tr>
                                                        </table>
                                                    </LayoutTemplate>
                                                </asp:ListView>
                                            </div>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                            <%-----------------------------------%>
                            <%--Separador pedidos--%>
                            <ajaxToolkit:TabPanel ID="MaterialOrdersTabPanel" runat="server" HeaderText="Pedidos">
                                <ContentTemplate>
                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <asp:ListView ID="LVOrder" runat="server" DataKeyNames="Id" ClientIDMode="AutoID">
                                                    <EmptyDataTemplate>
                                                        O aderente <%# Eval("Supporters.Designation") %> não tem pedidos.
                                                    </EmptyDataTemplate>
                                                    <ItemTemplate>
                                                        <tr id="Tr1" runat="server">
                                                            <td><%# String.Format("{0:dd/MM/yyyy}",Eval("OrderDate")) %></td>
                                                            <td><%# String.Format("{0:dd/MM/yyyy}",Eval("DispatchDate")) %></td>
                                                            <td><%# Eval("Products.Designation") %></td>
                                                            <td><%# Eval("Quantity") %></td>
                                                            <td><%# Eval("Lot") %></td>
                                                            <td><%# Eval("IdSystemUsers") %></td>
                                                        </tr>
                                                    </ItemTemplate>

                                                    <LayoutTemplate>
                                                        <table id="Table2" runat="server" class="table table-hover table-bordered">
                                                            <tr>
                                                                <th>Data pedido</th>
                                                                <th>Data envio</th>
                                                                <th>Produto</th>
                                                                <th>Quantidade</th>
                                                                <th>Lote</th>
                                                                <th>Utilizador</th>
                                                            </tr>
                                                            <tr id="itemPlaceholder" runat="server">
                                                            </tr>
                                                        </table>
                                                    </LayoutTemplate>
                                                </asp:ListView>
                                            </div>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                            <%-----------------------------------%>
                            <%--Separador Recibos--%>
                            <ajaxToolkit:TabPanel ID="ReceiptsTabPanel" runat="server" HeaderText="Recibos">
                                <ContentTemplate>
                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <asp:ListView ID="LVReceipts" runat="server" OnItemDataBound="LVReceipts_ItemDataBound" ClientIDMode="AutoID">
                                                    <EmptyDataTemplate>
                                                        O aderente <%# Eval("Supporters.Designation") %> não tem recibos.
                                                    </EmptyDataTemplate>
                                                    <ItemTemplate>
                                                        <tr id="Tr3" runat="server">
                                                            <td><%# Eval("Designation") %></td>
                                                            <td>
                                                                <asp:Label runat="server" ID="LabelReceiptValue" OnDataBinding="LabelReceiptValue_DataBinding" Text='<%# Eval("Soma","{0:C}") %>'></asp:Label></td>
                                                        </tr>
                                                    </ItemTemplate>

                                                    <LayoutTemplate>
                                                        <table id="Table4" runat="server" class="table table-hover table-bordered">
                                                            <thead>
                                                                <tr>
                                                                    <th>Nr Recibo</th>
                                                                    <th>Valor recibo</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <tr id="itemPlaceholder" runat="server">
                                                                </tr>
                                                            </tbody>
                                                            <tfoot>
                                                                <tr class="info">
                                                                    <td class="info">
                                                                        <asp:Label ID="LabelTotalCountReceipt" Text="" runat="server"></asp:Label>

                                                                    </td>
                                                                    <td class="info">
                                                                        <asp:Label ID="LabelTotalSumReceipt" Text="" runat="server"></asp:Label>
                                                                    </td>
                                                                </tr>
                                                            </tfoot>
                                                        </table>
                                                    </LayoutTemplate>
                                                </asp:ListView>
                                            </div>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                            <%-----------------------------------%>
                            <%--Separador Facturas--%>
                            <ajaxToolkit:TabPanel ID="InvoicesTabPanel" runat="server" HeaderText="Faturas">
                                <ContentTemplate>
                                    <div class="form-group">
                                        <div class="row">
                                            <div class="col-md-9">
                                                <asp:ListView ID="LVInvoice" runat="server" OnItemDataBound="LVInvoice_ItemDataBound" ClientIDMode="AutoID">
                                                    <EmptyDataTemplate>
                                                        O aderente <%# Eval("Supporters.Designation") %> não tem faturas.
                                                    </EmptyDataTemplate>
                                                    <ItemTemplate>
                                                        <tr id="Tr2" runat="server">
                                                            <td><%# Eval("Designation") %></td>
                                                            <td>
                                                                <asp:Label runat="server" ID="LabelInvoiceValue" OnDataBinding="LabelInvoiceValue_DataBinding" Text='<%# Eval("Soma","{0:C}") %>'></asp:Label>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>

                                                    <LayoutTemplate>
                                                        <table id="Table3" runat="server" class="table table-hover table-bordered">
                                                            <thead>
                                                                <tr>
                                                                    <th>Nr fatura</th>
                                                                    <th>Valor fatura</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <tr id="itemPlaceholder" runat="server">
                                                                </tr>
                                                            </tbody>
                                                            <tfoot>
                                                                <tr class="info">
                                                                    <td class="info">
                                                                        <asp:Label ID="LabelTotalCountInvoice" Text="" runat="server"></asp:Label>
                                                                    </td>
                                                                    <td class="info">
                                                                        <asp:Label ID="LabelTotalSumInvoice" Text="" runat="server"></asp:Label>
                                                                    </td>
                                                                </tr>
                                                            </tfoot>
                                                        </table>
                                                    </LayoutTemplate>
                                                </asp:ListView>
                                            </div>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </ajaxToolkit:TabPanel>
                        </ajaxToolkit:TabContainer>
                    </div>
                </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
